package cn.tedu.cat;

import cn.tedu.cat.Cat;
import cn.tedu.cat.CatConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class CatTest {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext ac = new AnnotationConfigApplicationContext(CatConfig.class);
        Cat c = ac.getBean("cat",Cat.class);
        c.setName("TOM");
        c.setColor("蓝色");
        c.setAge(9);

        System.out.println(c);

        // 获取对象
        Cat cat = ac.getBean("cat",Cat.class);
        System.out.println("s = " + c);
    }
}
